package core;

import NET.sourceforge.BplusJ.BplusJ.BplusTree;

public class BplusTreeTest {
	static String myTreeFileName = "D:/temp/t1";
	static String myBlocksFileName = "D:/temp/b1";

	public static void main(String[] args) throws Exception {

		BplusTree bpt = BplusTree.Initialize(myTreeFileName, myBlocksFileName,
				6);
		bpt.Set("1", "integer 1");
		bpt.Set("2", "integer 2");
		bpt.Commit();
		System.out.println(checkExist(1));
		System.out.println(checkExist(2));
	}

	private static boolean checkExist(int i) throws Exception {
		BplusTree btree = BplusTree.ReadOnly(myTreeFileName, myBlocksFileName);
		return btree.ContainsKey("" + i);
	}

}
